package cn.itcast.consumer.web;

import cn.itcast.consumer.feign.UserFeignApi;
import cn.itcast.consumer.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Description:
 * @Version: V1.0
 */
@RestController
@RequestMapping("feign")
public class FeignController {

    @Resource
    UserFeignApi userFeignApi;


    @GetMapping("/{id}")
    public User findUser(@PathVariable("id") String id) {
        User user = userFeignApi.queryById(id);
        return user;
    }

}